import Vue from 'vue'
import Axios from 'axios';
import AddProcess from './config'
import Qs from 'qs'

const baseURL = process.env.VUE_APP_API.replace(/\*/, window.location.origin);
export const isDev = process.env.NODE_ENV === 'development',
  axios = Axios.create({
    baseURL,
    timeout: 5000,
    transformRequest: [data => (!data || data.constructor.name === 'FormData') ? data : Qs.stringify(data)],
  })
Vue.prototype.axios = AddProcess(axios);